
propsage.namespace("prestige.tickets");

prestige.tickets.create = (function($, ui) {

	function initComponents() {
	}

	function initEventHandlers() {
		$('#Ticket_type').on('change', onTicketTypeChange);
	}
	
	function onTicketTypeChange() {
		var type = $(this).val();
		var referenceLabel = false;
		
		switch (type) {
			case 'Agency':
				break;
			case 'Agent':
				referenceLabel = 'CEA License No.';
				break;
			case 'Transaction':
				referenceLabel = 'Transaction No.';
				break;
		}
		
		if (referenceLabel == false) {
			$('.ticket-reference').hide();
		} else {
			$('.ticket-reference').show();
			$('label[for="Ticket_reference"]').text(referenceLabel);
		}
	}
	
	$(document).ready(function() {
		initComponents();
		initEventHandlers();
	});

}(jQuery, propsage.ui));